home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 July / Macworld (1999-07).dmg / Shareware World / Info / For Developers / Mops 3.4.sea / Mops source / System source / StrUtilities < prev    next >
MacBinary  |  1994-06-28  |  7.5 KB  |  [TEXT/MSET]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: StrUtilities

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Jun 28 20:27:52 1994, modified Tue Jun 28 20:27:52 1994, creator 'MSET', type ASCII, 7051 bytes "StrUtilities" , at 0x1c0b 286 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MSET]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 53 74 72 55 74 69 | 6c 69 74 69 65 73 00 00 |..StrUti|lities..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 53 45 | 54 01 00 00 00 00 00 00 |.TEXTMSE|T.......|
|00000050| 00 00 00 00 00 1b 8b 00 | 00 01 1e aa 36 70 88 aa |........|....6p..|
|00000060| 36 70 88 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |6p......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 87 26 00 00 |........|.....&..|
|00000080| 5c 20 55 74 69 6c 69 74 | 79 20 73 75 62 72 6f 75 |\ Utilit|y subrou|
|00000090| 74 69 6e 65 73 20 66 6f | 72 20 74 68 65 20 53 74 |tines fo|r the St|
|000000a0| 72 69 6e 67 2b 20 63 6c | 61 73 73 2e 0d 5c 20 53 |ring+ cl|ass..\ S|
|000000b0| 65 70 61 72 61 74 65 64 | 20 66 72 6f 6d 20 53 74 |eparated| from St|
|000000c0| 72 69 6e 67 2b 20 61 6e | 64 20 72 65 76 69 73 65 |ring+ an|d revise|
|000000d0| 64 20 2d 20 41 75 67 20 | 38 37 2e 0d 5c 20 45 72 |d - Aug |87..\ Er|
|000000e0| 72 6f 72 20 63 68 65 63 | 6b 69 6e 67 20 69 6d 70 |ror chec|king imp|
|000000f0| 72 6f 76 65 64 20 2d 20 | 4d 61 79 20 38 38 2e 0d |roved - |May 88..|
|00000100| 5c 20 56 65 72 73 69 6f | 6e 20 66 6f 72 20 4d 6f |\ Versio|n for Mo|
|00000110| 70 73 20 2d 20 4a 75 6e | 65 20 38 39 2e 0d 0d 09 |ps - Jun|e 89....|
|00000120| 30 09 76 61 6c 75 65 09 | 43 41 53 45 3f 09 09 5c |0.value.|CASE?..\|
|00000130| 20 54 72 75 65 20 69 66 | 20 63 61 73 65 20 74 6f | True if| case to|
|00000140| 20 62 65 20 73 69 67 6e | 69 66 69 63 61 6e 74 20 | be sign|ificant |
|00000150| 69 6e 20 63 6f 6d 70 61 | 72 69 73 6f 6e 73 0d 0d |in compa|risons..|
|00000160| 20 20 24 20 44 09 63 6f | 6e 73 74 61 6e 74 09 52 | $ D.co|nstant.R|
|00000170| 45 54 09 09 5c 20 43 61 | 72 72 69 61 67 65 20 72 |ET..\ Ca|rriage r|
|00000180| 65 74 75 72 6e 0d 20 20 | 20 20 30 09 76 61 6c 75 |eturn. | 0.valu|
|00000190| 65 09 09 24 53 54 41 52 | 54 09 5c 20 41 64 64 72 |e..$STAR|T.\ Addr|
|000001a0| 20 6f 66 20 73 74 61 72 | 74 20 6f 66 20 28 63 68 | of star|t of (ch|
|000001b0| 61 72 73 20 6f 66 29 20 | 63 75 72 72 65 6e 74 20 |ars of) |current |
|000001c0| 73 74 72 69 6e 67 2e 0d | 0d 0d 5c 09 09 3d 3d 3d |string..|..\..===|
|000001d0| 3d 3d 3d 3d 3d 20 20 54 | 52 54 42 4c 20 63 6c 61 |===== T|RTBL cla|
|000001e0| 73 73 20 20 3d 3d 3d 3d | 3d 3d 3d 3d 0d 0d 5c 20 |ss ====|====..\ |
|000001f0| 54 72 61 6e 73 6c 61 74 | 65 20 74 61 62 6c 65 73 |Translat|e tables|
|00000200| 20 61 6c 6c 6f 77 20 76 | 65 72 79 20 66 61 73 74 | allow v|ery fast|
|00000210| 20 73 65 61 72 63 68 69 | 6e 67 20 6f 66 20 73 74 | searchi|ng of st|
|00000220| 72 69 6e 67 73 20 66 6f | 72 20 73 70 65 63 69 66 |rings fo|r specif|
|00000230| 69 65 64 20 73 65 74 73 | 0d 5c 20 6f 66 20 63 68 |ied sets|.\ of ch|
|00000240| 61 72 61 63 74 65 72 73 | 2e 20 20 49 6e 20 65 66 |aracters|. In ef|
|00000250| 66 65 63 74 20 77 65 20 | 61 72 65 20 73 65 70 61 |fect we |are sepa|
|00000260| 72 61 74 69 6e 67 20 74 | 68 65 20 73 70 65 63 69 |rating t|he speci|
|00000270| 66 69 63 61 74 69 6f 6e | 20 6f 66 20 77 68 61 74 |fication| of what|
|00000280| 20 77 65 0d 5c 20 61 72 | 65 20 73 65 61 72 63 68 | we.\ ar|e search|
|00000290| 69 6e 67 20 66 6f 72 20 | 66 72 6f 6d 20 74 68 65 |ing for |from the|
|000002a0| 20 61 63 74 75 61 6c 20 | 73 65 61 72 63 68 20 6f | actual |search o|
|000002b0| 70 65 72 61 74 69 6f 6e | 20 69 74 73 65 6c 66 2e |peration| itself.|
|000002c0| 20 20 54 68 69 73 20 61 | 6c 6c 6f 77 73 20 61 6e | This a|llows an|
|000002d0| 0d 5c 20 75 6e 63 6c 75 | 74 74 65 72 65 64 20 61 |.\ unclu|ttered a|
|000002e0| 6e 64 20 65 78 74 72 65 | 6d 65 6c 79 20 66 61 73 |nd extre|mely fas|
|000002f0| 74 20 73 65 61 72 63 68 | 20 6f 70 65 72 61 74 69 |t search| operati|
|00000300| 6f 6e 20 28 74 68 65 20 | 53 43 41 4e 3a 20 61 6e |on (the |SCAN: an|
|00000310| 64 20 3c 53 43 41 4e 3a | 20 6d 65 74 68 6f 64 73 |d <SCAN:| methods|
|00000320| 0d 5c 20 6f 66 20 63 6c | 61 73 73 20 53 54 52 49 |.\ of cl|ass STRI|
|00000330| 4e 47 2b 29 2c 20 61 6e | 64 20 69 74 20 61 6c 73 |NG+), an|d it als|
|00000340| 6f 20 61 6c 6c 6f 77 73 | 20 61 20 76 65 72 79 20 |o allows| a very |
|00000350| 66 6c 65 78 69 62 6c 65 | 20 28 61 6e 64 20 65 61 |flexible| (and ea|
|00000360| 73 69 6c 79 20 65 78 74 | 65 6e 73 69 62 6c 65 29 |sily ext|ensible)|
|00000370| 0d 5c 20 63 68 6f 69 63 | 65 20 6f 66 20 77 68 61 |.\ choic|e of wha|
|00000380| 74 20 74 6f 20 73 65 61 | 72 63 68 20 66 6f 72 2e |t to sea|rch for.|
|00000390| 20 20 54 68 65 20 73 65 | 74 75 70 20 74 69 6d 65 | The se|tup time|
|000003a0| 20 66 6f 72 20 74 72 61 | 6e 73 6c 61 74 65 20 74 | for tra|nslate t|
|000003b0| 61 62 6c 65 73 20 63 61 | 6e 0d 5c 20 67 65 6e 65 |ables ca|n.\ gene|
|000003c0| 72 61 6c 6c 79 20 62 65 | 20 66 61 63 74 6f 72 65 |rally be| factore|
|000003d0| 64 20 6f 75 74 20 6f 66 | 20 69 6e 6e 65 72 20 6c |d out of| inner l|
|000003e0| 6f 6f 70 73 2c 20 6f 72 | 20 64 6f 6e 65 20 61 74 |oops, or| done at|
|000003f0| 20 63 6f 6d 70 69 6c 65 | 20 74 69 6d 65 2c 20 61 | compile| time, a|
|00000400| 6e 64 20 69 73 0d 5c 20 | 71 75 69 74 65 20 66 61 |nd is.\ |quite fa|
|00000410| 73 74 2c 20 61 6e 79 77 | 61 79 2e 0d 5c 20 57 65 |st, anyw|ay..\ We|
|00000420| 20 66 69 72 73 74 20 64 | 65 66 69 6e 65 20 61 20 | first d|efine a |
|00000430| 63 6c 61 73 73 20 28 74 | 72 74 62 6c 29 20 77 68 |class (t|rtbl) wh|
|00000440| 69 63 68 20 69 73 20 6e | 65 65 64 65 64 20 74 6f |ich is n|eeded to|
|00000450| 20 64 65 66 69 6e 65 20 | 74 68 65 20 74 61 62 6c | define |the tabl|
|00000460| 65 20 6d 61 70 70 69 6e | 67 0d 5c 20 6c 6f 77 65 |e mappin|g.\ lowe|
|00000470| 72 20 63 61 73 65 20 6c | 65 74 74 65 72 73 20 74 |r case l|etters t|
|00000480| 6f 20 75 70 70 65 72 20 | 63 61 73 65 2e 20 20 54 |o upper |case. T|
|00000490| 68 69 73 20 74 61 62 6c | 65 20 69 73 20 74 68 65 |his tabl|e is the|
|000004a0| 6e 20 75 73 65 64 20 62 | 79 20 73 6f 6d 65 20 6f |n used b|y some o|
|000004b0| 66 0d 5c 20 74 68 65 20 | 6d 65 74 68 6f 64 73 20 |f.\ the |methods |
|000004c0| 69 6e 20 74 68 65 20 74 | 72 74 62 6c 20 63 6c 61 |in the t|rtbl cla|
|000004d0| 73 73 20 70 72 6f 70 65 | 72 2e 0d 0d 3a 63 6c 61 |ss prope|r...:cla|
|000004e0| 73 73 20 28 54 52 54 42 | 4c 29 20 20 73 75 70 65 |ss (TRTB|L) supe|
|000004f0| 72 7b 20 6f 62 6a 65 63 | 74 20 7d 0d 0d 72 65 63 |r{ objec|t }..rec|
|00000500| 6f 72 64 0d 7b 09 09 69 | 6e 74 09 09 43 4f 55 4e |ord.{..i|nt..COUN|
|00000510| 54 0d 09 32 35 36 09 62 | 79 74 65 73 09 54 48 45 |T..256.b|ytes.THE|
|00000520| 54 42 4c 0d 7d 0d 0d 3a | 6d 20 54 42 4c 3a 20 20 |TBL.}..:|m TBL: |
|00000530| 61 64 64 72 3a 20 74 68 | 65 54 62 6c 20 20 3b 6d |addr: th|eTbl ;m|
|00000540| 0d 0d 3a 6d 20 3e 55 43 | 3a 0d 09 61 64 64 72 3a |..:m >UC|:..addr:|
|00000550| 20 74 68 65 54 62 6c 20 | 20 26 20 41 20 20 2b 0d | theTbl | & A +.|
|00000560| 09 61 64 64 72 3a 20 74 | 68 65 54 62 6c 20 20 26 |.addr: t|heTbl &|
|00000570| 20 61 20 20 2b 0d 09 32 | 36 20 20 63 6d 6f 76 65 | a +..2|6 cmove|
|00000580| 20 20 3b 6d 0d 0d 3a 6d | 63 6f 64 65 20 54 52 41 | ;m..:m|code TRA|
|00000590| 4e 53 43 3a 09 5c 20 28 | 20 63 20 2d 2d 20 63 27 |NSC:.\ (| c -- c'|
|000005a0| 20 29 20 20 54 72 61 6e | 73 6c 61 74 65 73 20 31 | ) Tran|slates 1|
|000005b0| 20 63 68 61 72 20 75 73 | 69 6e 67 20 74 68 65 20 | char us|ing the |
|000005c0| 74 61 62 6c 65 2e 0d 09 | 4d 4f 56 45 09 28 53 50 |table...|MOVE.(SP|
|000005d0| 29 2c 44 30 0d 09 4d 4f | 56 45 2e 42 09 32 28 41 |),D0..MO|VE.B.2(A|
|000005e0| 32 2c 44 30 2e 57 29 2c | 33 28 53 50 29 0d 3b 6d |2,D0.W),|3(SP).;m|
|000005f0| 63 6f 64 65 0d 0d 3b 63 | 6c 61 73 73 0d 0d 0d 28 |code..;c|lass...(|
|00000600| 74 72 74 62 6c 29 20 55 | 43 54 42 4c 09 09 5c 20 |trtbl) U|CTBL..\ |
|00000610| 4d 61 70 73 20 6c 6f 77 | 65 72 20 63 61 73 65 20 |Maps low|er case |
|00000620| 6c 65 74 74 65 72 73 20 | 74 6f 20 75 70 70 65 72 |letters |to upper|
|00000630| 20 63 61 73 65 2c 20 61 | 6e 64 0d 09 09 09 09 09 | case, a|nd......|
|00000640| 5c 20 20 6c 65 61 76 65 | 73 20 65 76 65 72 79 74 |\ leave|s everyt|
|00000650| 68 69 6e 67 20 65 6c 73 | 65 20 75 6e 63 68 61 6e |hing els|e unchan|
|00000660| 67 65 64 2e 0d 0d 3a 20 | 58 58 0d 09 30 20 20 20 |ged...: |XX..0 |
|00000670| 74 62 6c 3a 20 55 43 74 | 62 6c 20 20 32 35 36 20 |tbl: UCt|bl 256 |
|00000680| 20 62 6f 75 6e 64 73 0d | 09 44 4f 20 20 64 75 70 | bounds.|.DO dup|
|00000690| 20 69 20 63 21 20 20 31 | 2b 20 20 4c 4f 4f 50 0d | i c! 1|+ LOOP.|
|000006a0| 09 64 72 6f 70 20 20 3e | 75 63 3a 20 55 43 74 62 |.drop >|uc: UCtb|
|000006b0| 6c 20 20 3b 0d 0d 78 78 | 20 20 66 6f 72 67 65 74 |l ;..xx| forget|
|000006c0| 20 78 78 0d 0d 3a 63 6f | 64 65 20 28 53 45 4c 43 | xx..:co|de (SELC|
|000006d0| 29 09 09 5c 20 53 75 62 | 72 6f 75 74 69 6e 65 20 |)..\ Sub|routine |
|000006e0| 75 73 65 64 20 62 79 20 | 53 45 4c 43 48 41 52 3a |used by |SELCHAR:|
|000006f0| 20 61 6e 64 20 53 45 4c | 43 48 41 52 4e 43 3a 2e | and SEL|CHARNC:.|
|00000700| 0d 09 41 44 44 51 2e 57 | 09 23 31 2c 28 41 32 29 |..ADDQ.W|.#1,(A2)|
|00000710| 0d 09 4d 4f 56 45 2e 57 | 09 28 41 32 29 2b 2c 44 |..MOVE.W|.(A2)+,D|
|00000720| 31 0d 09 4d 4f 56 45 2e | 42 09 44 31 2c 30 28 41 |1..MOVE.|B.D1,0(A|
|00000730| 32 2c 44 32 2e 57 29 0d | 3b 63 6f 64 65 0d 0d 0d |2,D2.W).|;code...|
|00000740| 3a 63 6c 61 73 73 20 54 | 52 54 42 4c 20 20 73 75 |:class T|RTBL su|
|00000750| 70 65 72 7b 20 28 74 72 | 74 62 6c 29 20 7d 0d 0d |per{ (tr|tbl) }..|
|00000760| 3a 6d 63 6f 64 65 20 43 | 4c 45 41 52 3a 0d 09 6c |:mcode C|LEAR:..l|
|00000770| 6f 63 0d 09 43 4c 52 2e | 57 09 28 41 32 29 2b 0d |oc..CLR.|W.(A2)+.|
|00000780| 09 4d 4f 56 45 51 09 23 | 36 33 2c 44 30 0d 6c 6f |.MOVEQ.#|63,D0.lo|
|00000790| 6f 70 09 43 4c 52 09 28 | 41 32 29 2b 0d 09 44 42 |op.CLR.(|A2)+..DB|
|000007a0| 52 41 09 44 30 2c 6c 6f | 6f 70 0d 3b 6d 63 6f 64 |RA.D0,lo|op.;mcod|
|000007b0| 65 0d 0d 0d 3a 6d 20 50 | 55 54 3a 20 20 7b 20 61 |e...:m P|UT: { a|
|000007c0| 64 64 72 20 6c 65 6e 20 | 2d 2d 20 7d 0d 09 61 64 |ddr len |-- }..ad|
|000007d0| 64 72 20 20 61 64 64 72 | 3a 20 74 68 65 54 62 6c |dr addr|: theTbl|
|000007e0| 20 20 6c 65 6e 20 32 35 | 36 20 6d 69 6e 20 20 63 | len 25|6 min c|
|000007f0| 6d 6f 76 65 20 20 3b 6d | 0d 0d 0d 3a 6d 63 6f 64 |move ;m|...:mcod|
|00000800| 65 20 53 45 4c 43 48 41 | 52 53 3a 09 5c 20 28 20 |e SELCHA|RS:.\ ( |
|00000810| 61 64 64 72 20 6c 65 6e | 20 2d 2d 20 29 0d 09 6c |addr len| -- )..l|
|00000820| 6f 63 0d 09 50 4f 50 09 | 44 30 09 09 3b 20 44 30 |oc..POP.|D0..; D0|
|00000830| 20 3d 20 6c 65 6e 0d 09 | 50 4f 50 09 41 31 09 09 | = len..|POP.A1..|
|00000840| 3b 20 41 31 20 3d 20 61 | 64 64 72 0d 09 41 44 44 |; A1 = a|ddr..ADD|
|00000850| 09 44 30 2c 41 31 0d 09 | 4d 4f 56 45 09 44 30 2c |.D0,A1..|MOVE.D0,|
|00000860| 44 31 0d 09 41 44 44 2e | 57 09 28 41 32 29 2c 44 |D1..ADD.|W.(A2),D|
|00000870| 31 0d 09 4d 4f 56 45 2e | 57 09 44 31 2c 28 41 32 |1..MOVE.|W.D1,(A2|
|00000880| 29 2b 0d 09 4d 4f 56 45 | 51 09 23 30 2c 44 32 0d |)+..MOVE|Q.#0,D2.|
|00000890| 09 42 52 41 2e 53 09 6c | 70 74 73 74 0d 0d 6c 6f |.BRA.S.l|ptst..lo|
|000008a0| 6f 70 09 4d 4f 56 45 2e | 42 09 2d 28 41 31 29 2c |op.MOVE.|B.-(A1),|
|000008b0| 44 32 0d 09 4d 4f 56 45 | 2e 42 09 44 31 2c 30 28 |D2..MOVE|.B.D1,0(|
|000008c0| 41 32 2c 44 32 2e 57 29 | 0d 09 53 55 42 51 09 23 |A2,D2.W)|..SUBQ.#|
|000008d0| 31 2c 44 31 0d 6c 70 74 | 73 74 09 44 42 52 41 09 |1,D1.lpt|st.DBRA.|
|000008e0| 44 30 2c 6c 6f 6f 70 0d | 3b 6d 63 6f 64 65 0d 0d |D0,loop.|;mcode..|
|000008f0| 0d 3a 6d 63 6f 64 65 20 | 53 45 4c 43 48 41 52 3a |.:mcode |SELCHAR:|
|00000900| 09 09 5c 20 28 20 63 20 | 2d 2d 20 29 0d 09 50 4f |..\ ( c |-- )..PO|
|00000910| 50 09 44 32 0d 09 42 53 | 52 09 64 69 63 5b 28 73 |P.D2..BS|R.dic[(s|
|00000920| 65 6c 63 29 5d 0d 3b 6d | 63 6f 64 65 0d 0d 0d 3a |elc)].;m|code...:|
|00000930| 6d 63 6f 64 65 20 53 45 | 4c 43 48 41 52 4e 43 3a |mcode SE|LCHARNC:|
|00000940| 09 5c 20 28 20 63 20 2d | 2d 20 29 20 20 22 53 65 |.\ ( c -|- ) "Se|
|00000950| 6c 43 68 61 72 2c 20 6e | 6f 20 63 61 73 65 22 2e |lChar, n|o case".|
|00000960| 0d 09 09 5c 20 53 65 6c | 65 63 74 73 20 61 20 63 |...\ Sel|ects a c|
|00000970| 68 61 72 61 63 74 65 72 | 2c 20 61 6e 64 20 69 66 |haracter|, and if|
|00000980| 20 69 74 20 69 73 20 61 | 20 6c 65 74 74 65 72 2c | it is a| letter,|
|00000990| 0d 09 09 5c 20 65 6e 74 | 65 72 73 20 74 68 65 20 |...\ ent|ers the |
|000009a0| 73 61 6d 65 20 76 61 6c | 75 65 20 69 6e 20 74 68 |same val|ue in th|
|000009b0| 65 20 4c 43 20 61 6e 64 | 20 55 43 20 70 6f 73 69 |e LC and| UC posi|
|000009c0| 74 69 6f 6e 73 20 6f 66 | 20 74 68 65 0d 09 09 5c |tions of| the...\|
|000009d0| 20 74 61 62 6c 65 2c 20 | 73 6f 20 74 68 61 74 20 | table, |so that |
|000009e0| 63 61 73 65 20 77 69 6c | 6c 20 69 6e 20 65 66 66 |case wil|l in eff|
|000009f0| 65 63 74 20 62 65 20 69 | 67 6e 6f 72 65 64 20 77 |ect be i|gnored w|
|00000a00| 68 65 6e 20 74 68 65 0d | 09 09 5c 20 74 61 62 6c |hen the.|..\ tabl|
|00000a10| 65 20 69 73 20 75 73 65 | 64 2e 0d 09 50 4f 50 09 |e is use|d...POP.|
|00000a20| 44 32 0d 09 4c 45 41 09 | 31 30 28 64 69 63 5b 55 |D2..LEA.|10(dic[U|
|00000a30| 43 74 62 6c 5d 29 2c 41 | 30 09 3b 20 4f 66 66 73 |Ctbl]),A|0.; Offs|
|00000a40| 65 74 20 69 73 20 6f 66 | 66 73 20 74 6f 20 5e 6f |et is of|fs to ^o|
|00000a50| 62 6a 2c 20 70 6c 75 73 | 20 32 0d 09 4d 4f 56 45 |bj, plus| 2..MOVE|
|00000a60| 2e 42 09 30 28 41 30 2c | 44 32 2e 57 29 2c 44 32 |.B.0(A0,|D2.W),D2|
|00000a70| 09 09 3b 20 43 6f 6e 76 | 65 72 74 20 63 68 61 72 |..; Conv|ert char|
|00000a80| 20 74 6f 20 75 70 70 65 | 72 20 63 61 73 65 0d 09 | to uppe|r case..|
|00000a90| 42 53 52 09 64 69 63 5b | 28 73 65 6c 63 29 5d 0d |BSR.dic[|(selc)].|
|00000aa0| 09 43 4d 50 49 2e 42 09 | 23 24 34 31 2c 44 32 0d |.CMPI.B.|#$41,D2.|
|00000ab0| 09 42 4c 54 2e 53 09 65 | 6e 64 0d 09 43 4d 50 49 |.BLT.S.e|nd..CMPI|
|00000ac0| 2e 42 09 23 24 35 41 2c | 44 32 0d 09 42 47 54 2e |.B.#$5A,|D2..BGT.|
|00000ad0| 53 09 65 6e 64 0d 09 4f | 52 49 2e 42 09 23 24 32 |S.end..O|RI.B.#$2|
|00000ae0| 30 2c 44 32 0d 09 4d 4f | 56 45 2e 42 09 44 31 2c |0,D2..MO|VE.B.D1,|
|00000af0| 30 28 41 32 2c 44 32 2e | 57 29 0d 65 6e 64 0d 3b |0(A2,D2.|W).end.;|
|00000b00| 6d 63 6f 64 65 0d 09 0d | 3a 6d 63 6f 64 65 20 53 |mcode...|:mcode S|
|00000b10| 45 4c 52 41 4e 47 45 3a | 09 5c 20 28 20 6c 6f 20 |ELRANGE:|.\ ( lo |
|00000b20| 68 69 20 2d 2d 20 29 0d | 09 6c 6f 63 0d 09 41 44 |hi -- ).|.loc..AD|
|00000b30| 44 51 09 23 32 2c 41 32 | 0d 09 50 4f 50 09 44 30 |DQ.#2,A2|..POP.D0|
|00000b40| 09 09 3b 20 68 69 0d 09 | 50 4f 50 09 44 31 09 09 |..; hi..|POP.D1..|
|00000b50| 3b 20 6c 6f 0d 09 41 44 | 44 09 44 31 2c 41 32 0d |; lo..AD|D.D1,A2.|
|00000b60| 09 53 55 42 09 44 31 2c | 44 30 0d 09 42 4c 54 2e |.SUB.D1,|D0..BLT.|
|00000b70| 53 09 65 6e 64 0d 09 4d | 4f 56 45 51 09 23 31 2c |S.end..M|OVEQ.#1,|
|00000b80| 44 32 0d 0d 6c 6f 6f 70 | 09 4d 4f 56 45 2e 42 09 |D2..loop|.MOVE.B.|
|00000b90| 44 32 2c 28 41 32 29 2b | 0d 6c 70 74 73 74 09 44 |D2,(A2)+|.lptst.D|
|00000ba0| 42 52 41 09 44 30 2c 6c | 6f 6f 70 0d 65 6e 64 0d |BRA.D0,l|oop.end.|
|00000bb0| 3b 6d 63 6f 64 65 0d 0d | 3a 6d 63 6f 64 65 20 49 |;mcode..|:mcode I|
|00000bc0| 4e 56 45 52 54 3a 0d 09 | 6c 6f 63 0d 09 41 44 44 |NVERT:..|loc..ADD|
|00000bd0| 51 09 23 32 2c 41 32 0d | 09 4d 4f 56 45 51 09 23 |Q.#2,A2.|.MOVEQ.#|
|00000be0| 32 35 35 2c 44 30 0d 6c | 6f 6f 70 09 54 53 54 2e |255,D0.l|oop.TST.|
|00000bf0| 42 09 28 41 32 29 0d 09 | 53 45 51 09 28 41 32 29 |B.(A2)..|SEQ.(A2)|
|00000c00| 2b 0d 09 44 42 52 41 09 | 44 30 2c 6c 6f 6f 70 0d |+..DBRA.|D0,loop.|
|00000c10| 3b 6d 63 6f 64 65 0d 0d | 3b 63 6c 61 73 73 0d 0d |;mcode..|;class..|
|00000c20| 0d 5c 20 47 45 54 49 54 | 20 69 73 20 61 20 63 6f |.\ GETIT| is a co|
|00000c30| 64 65 20 73 75 62 72 6f | 75 74 69 6e 65 20 74 6f |de subro|utine to|
|00000c40| 20 67 65 74 20 74 68 65 | 20 61 64 64 72 65 73 73 | get the| address|
|00000c50| 20 61 6e 64 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | and len|gth of t|
|00000c60| 68 65 20 61 63 74 69 76 | 65 20 70 61 72 74 0d 5c |he activ|e part.\|
|00000c70| 20 6f 66 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | of the |current |
|00000c80| 73 74 72 69 6e 67 2e 20 | 20 41 32 20 70 6f 69 6e |string. | A2 poin|
|00000c90| 74 73 20 74 6f 20 74 68 | 65 20 73 74 72 69 6e 67 |ts to th|e string|
|00000ca0| 20 6f 62 6a 65 63 74 2e | 0d 5c 0d 5c 20 52 65 74 | object.|.\.\ Ret|
|00000cb0| 75 72 6e 73 3a 0d 5c 09 | 41 30 09 61 64 64 72 20 |urns:.\.|A0.addr |
|00000cc0| 6f 66 20 66 69 72 73 74 | 20 63 68 61 72 20 6f 66 |of first| char of|
|00000cd0| 20 74 68 65 20 61 63 74 | 69 76 65 20 70 61 72 74 | the act|ive part|
|00000ce0| 0d 5c 09 44 30 09 6c 65 | 6e 67 74 68 20 6f 66 20 |.\.D0.le|ngth of |
|00000cf0| 61 63 74 69 76 65 20 70 | 61 72 74 0d 5c 09 44 32 |active p|art.\.D2|
|00000d00| 20 28 6c 6f 20 68 61 6c | 66 29 20 20 68 69 67 68 | (lo hal|f) high|
|00000d10| 20 31 36 20 62 69 74 73 | 20 6f 66 20 6c 65 6e 67 | 16 bits| of leng|
|00000d20| 74 68 20 2d 20 6d 61 79 | 20 62 65 20 75 73 65 64 |th - may| be used|
|00000d30| 20 61 73 20 61 6e 20 6f | 75 74 65 72 20 6c 6f 6f | as an o|uter loo|
|00000d40| 70 0d 5c 20 20 20 20 20 | 20 20 09 09 63 6f 75 6e |p.\ | ..coun|
|00000d50| 74 65 72 20 69 6e 20 44 | 42 78 78 20 6c 6f 6f 70 |ter in D|Bxx loop|
|00000d60| 73 2e 0d 5c 09 43 43 09 | 72 65 73 75 6c 74 20 6f |s..\.CC.|result o|
|00000d70| 66 20 73 75 62 74 72 61 | 63 74 69 6e 67 20 50 4f |f subtra|cting PO|
|00000d80| 53 20 66 72 6f 6d 20 4c | 49 4d 20 74 6f 20 67 65 |S from L|IM to ge|
|00000d90| 74 20 74 68 65 20 6c 65 | 6e 67 74 68 2e 0d 5c 20 |t the le|ngth..\ |
|00000da0| 09 24 73 74 61 72 74 09 | 61 64 64 72 20 6f 66 20 |.$start.|addr of |
|00000db0| 74 68 65 20 73 74 61 72 | 74 20 6f 66 20 74 68 65 |the star|t of the|
|00000dc0| 20 77 68 6f 6c 65 20 73 | 74 72 69 6e 67 0d 5c 0d | whole s|tring.\.|
|00000dd0| 5c 20 49 66 20 74 68 69 | 73 20 6c 65 6e 67 74 68 |\ If thi|s length|
|00000de0| 20 74 75 72 6e 73 20 6f | 75 74 20 74 6f 20 62 65 | turns o|ut to be|
|00000df0| 20 6e 65 67 61 74 69 76 | 65 2c 20 24 43 48 4b 20 | negativ|e, $CHK |
|00000e00| 69 73 20 63 61 6c 6c 65 | 64 20 74 6f 20 67 69 76 |is calle|d to giv|
|00000e10| 65 20 61 6e 20 65 72 72 | 6f 72 20 74 72 61 70 2e |e an err|or trap.|
|00000e20| 0d 5c 20 57 65 20 64 6f | 6e 27 74 20 74 61 6b 65 |.\ We do|n't take|
|00000e30| 20 61 20 6c 65 6e 67 74 | 68 20 6f 66 20 7a 65 72 | a lengt|h of zer|
|00000e40| 6f 20 61 73 20 61 6e 20 | 65 72 72 6f 72 20 28 74 |o as an |error (t|
|00000e50| 68 65 72 65 20 61 72 65 | 20 73 6f 6d 65 20 73 69 |here are| some si|
|00000e60| 74 75 61 74 69 6f 6e 73 | 20 77 68 65 72 65 0d 5c |tuations| where.\|
|00000e70| 20 74 68 69 73 20 69 73 | 20 71 75 69 74 65 20 6c | this is| quite l|
|00000e80| 65 67 69 74 69 6d 61 74 | 65 29 2e 20 20 54 68 6f |egitimat|e). Tho|
|00000e90| 73 65 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 77 68 |se opera|tions wh|
|00000ea0| 69 63 68 20 64 6f 6e 27 | 74 20 6c 69 6b 65 20 61 |ich don'|t like a|
|00000eb0| 20 7a 65 72 6f 0d 5c 20 | 6c 65 6e 67 74 68 20 63 | zero.\ |length c|
|00000ec0| 61 6e 20 63 61 6c 6c 20 | 24 43 48 4b 20 74 68 65 |an call |$CHK the|
|00000ed0| 6d 73 65 6c 76 65 73 2e | 0d 5c 20 54 68 69 73 20 |mselves.|.\ This |
|00000ee0| 73 75 62 72 6f 75 74 69 | 6e 65 20 6d 75 73 74 20 |subrouti|ne must |
|00000ef0| 62 65 20 63 61 6c 6c 65 | 64 20 66 72 6f 6d 20 61 |be calle|d from a|
|00000f00| 20 6d 65 74 68 6f 64 2c | 20 77 69 74 68 20 41 32 | method,| with A2|
|00000f10| 20 75 6e 64 69 73 74 75 | 72 62 65 64 2e 0d 5c 20 | undistu|rbed..\ |
|00000f20| 4f 6e 6c 79 20 41 30 2c | 20 41 32 2c 20 44 30 20 |Only A0,| A2, D0 |
|00000f30| 61 6e 64 20 44 32 20 61 | 72 65 20 61 6c 74 65 72 |and D2 a|re alter|
|00000f40| 65 64 2e 0d 0d 3a 63 6f | 64 65 20 47 45 54 49 54 |ed...:co|de GETIT|
|00000f50| 0d 09 6c 6f 63 0d 09 4d | 4f 56 45 09 28 41 32 29 |..loc..M|OVE.(A2)|
|00000f60| 2c 41 30 09 3b 20 41 30 | 20 3d 20 68 61 6e 64 6c |,A0.; A0| = handl|
|00000f70| 65 0d 09 4d 4f 56 45 09 | 28 41 30 29 2c 41 30 09 |e..MOVE.|(A0),A0.|
|00000f80| 3b 20 44 65 72 65 66 65 | 72 65 6e 63 65 20 69 74 |; Derefe|rence it|
|00000f90| 20 2d 20 61 64 64 72 20 | 6f 66 20 73 74 61 72 74 | - addr |of start|
|00000fa0| 20 6f 66 20 73 74 72 69 | 6e 67 0d 09 4d 4f 56 45 | of stri|ng..MOVE|
|00000fb0| 09 41 30 2c 64 69 63 5b | 24 73 74 61 72 74 5d 09 |.A0,dic[|$start].|
|00000fc0| 3b 20 4c 65 61 76 65 20 | 69 6e 20 24 73 74 61 72 |; Leave |in $star|
|00000fd0| 74 0d 09 41 44 44 09 38 | 28 41 32 29 2c 41 30 09 |t..ADD.8|(A2),A0.|
|00000fe0| 3b 20 41 64 64 20 50 4f | 53 2c 20 67 69 76 69 6e |; Add PO|S, givin|
|00000ff0| 67 20 61 64 64 72 20 6f | 66 20 73 74 61 72 74 20 |g addr o|f start |
|00001000| 6f 66 20 61 63 74 69 76 | 65 20 70 61 72 74 0d 09 |of activ|e part..|
|00001010| 4d 4f 56 45 09 31 32 28 | 41 32 29 2c 44 30 09 3b |MOVE.12(|A2),D0.;|
|00001020| 20 44 30 20 3d 20 4c 49 | 4d 0d 09 53 55 42 09 38 | D0 = LI|M..SUB.8|
|00001030| 28 41 32 29 2c 44 30 09 | 3b 20 53 75 62 74 72 61 |(A2),D0.|; Subtra|
|00001040| 63 74 20 50 4f 53 2c 20 | 67 69 76 69 6e 67 20 6c |ct POS, |giving l|
|00001050| 65 6e 67 74 68 0d 09 4d | 4f 56 45 09 44 30 2c 44 |ength..M|OVE.D0,D|
|00001060| 32 0d 09 53 57 41 50 09 | 44 32 09 3b 20 48 69 20 |2..SWAP.|D2.; Hi |
|00001070| 31 36 20 62 69 74 73 20 | 74 6f 20 6c 6f 20 68 61 |16 bits |to lo ha|
|00001080| 6c 66 20 6f 66 20 44 32 | 0d 09 54 53 54 09 44 30 |lf of D2|..TST.D0|
|00001090| 09 3b 20 54 65 73 74 20 | 6c 65 6e 67 74 68 0d 09 |.; Test |length..|
|000010a0| 42 47 45 2e 53 09 65 6e | 64 0d 09 4a 4d 50 09 64 |BGE.S.en|d..JMP.d|
|000010b0| 69 63 5b 24 66 61 69 6c | 5d 09 3b 20 49 66 20 6e |ic[$fail|].; If n|
|000010c0| 65 67 61 74 69 76 65 2c | 20 65 72 72 6f 72 0d 65 |egative,| error.e|
|000010d0| 6e 64 0d 3b 63 6f 64 65 | 0d 0d 0d 5c 20 43 43 4d |nd.;code|...\ CCM|
|000010e0| 50 20 69 73 20 74 68 65 | 20 70 72 69 6d 69 74 69 |P is the| primiti|
|000010f0| 76 65 20 73 75 62 72 6f | 75 74 69 6e 65 20 66 6f |ve subro|utine fo|
|00001100| 72 20 70 65 72 66 6f 72 | 6d 69 6e 67 20 73 74 72 |r perfor|ming str|
|00001110| 69 6e 67 20 63 6f 6d 70 | 61 72 69 73 6f 6e 2e 0d |ing comp|arison..|
|00001120| 5c 09 41 30 20 2d 3e 20 | 73 74 72 69 6e 67 32 0d |\.A0 -> |string2.|
|00001130| 5c 09 41 31 20 2d 3e 20 | 73 74 72 69 6e 67 31 0d |\.A1 -> |string1.|
|00001140| 5c 09 44 30 20 3d 20 6c | 65 6e 67 74 68 0d 5c 20 |\.D0 = l|ength.\ |
|00001150| 41 73 73 75 6d 65 73 20 | 6c 65 6e 67 74 68 20 69 |Assumes |length i|
|00001160| 73 20 6c 65 73 73 20 74 | 68 61 6e 20 36 34 4b 2e |s less t|han 64K.|
|00001170| 0d 5c 20 52 65 74 75 72 | 6e 73 20 77 69 74 68 20 |.\ Retur|ns with |
|00001180| 74 68 65 20 43 43 20 73 | 65 74 20 61 70 70 72 6f |the CC s|et appro|
|00001190| 70 72 69 61 74 65 6c 79 | 2e 0d 5c 20 55 73 65 73 |priately|..\ Uses|
|000011a0| 20 74 68 6f 73 65 20 72 | 65 67 69 73 74 65 72 73 | those r|egisters|
|000011b0| 2e 0d 0d 3a 63 6f 64 65 | 20 43 43 4d 50 0d 09 6c |...:code| CCMP..l|
|000011c0| 6f 63 0d 09 53 55 42 51 | 09 23 31 2c 44 30 0d 09 |oc..SUBQ|.#1,D0..|
|000011d0| 42 4d 49 2e 53 09 65 71 | 75 61 6c 0d 09 54 53 54 |BMI.S.eq|ual..TST|
|000011e0| 09 64 69 63 5b 63 61 73 | 65 3f 5d 0d 09 42 45 51 |.dic[cas|e?]..BEQ|
|000011f0| 2e 53 09 6e 6f 63 61 73 | 65 0d 0d 6c 6f 6f 70 31 |.S.nocas|e..loop1|
|00001200| 09 43 4d 50 4d 2e 42 09 | 28 41 30 29 2b 2c 28 41 |.CMPM.B.|(A0)+,(A|
|00001210| 31 29 2b 0d 09 44 42 4e | 45 09 44 30 2c 6c 6f 6f |1)+..DBN|E.D0,loo|
|00001220| 70 31 0d 09 52 54 53 0d | 0d 65 71 75 61 6c 09 43 |p1..RTS.|.equal.C|
|00001230| 4d 50 2e 57 09 44 30 2c | 44 30 0d 09 52 54 53 0d |MP.W.D0,|D0..RTS.|
|00001240| 0d 6e 6f 63 61 73 65 09 | 4d 4f 56 45 4d 09 44 32 |.nocase.|MOVEM.D2|
|00001250| 2f 44 33 2f 41 32 2c 2d | 28 53 50 29 0d 09 4d 4f |/D3/A2,-|(SP)..MO|
|00001260| 56 45 51 09 23 30 2c 44 | 32 0d 09 4c 45 41 09 31 |VEQ.#0,D|2..LEA.1|
|00001270| 30 28 64 69 63 5b 55 43 | 74 62 6c 5d 29 2c 41 32 |0(dic[UC|tbl]),A2|
|00001280| 0d 0d 6c 6f 6f 70 32 09 | 43 4d 50 4d 2e 42 09 28 |..loop2.|CMPM.B.(|
|00001290| 41 30 29 2b 2c 28 41 31 | 29 2b 0d 6c 70 32 74 73 |A0)+,(A1|)+.lp2ts|
|000012a0| 74 09 44 42 4e 45 09 44 | 30 2c 6c 6f 6f 70 32 0d |t.DBNE.D|0,loop2.|
|000012b0| 09 42 45 51 2e 53 09 65 | 6e 64 0d 09 4d 4f 56 45 |.BEQ.S.e|nd..MOVE|
|000012c0| 2e 42 09 2d 31 28 41 31 | 29 2c 44 32 0d 09 4d 4f |.B.-1(A1|),D2..MO|
|000012d0| 56 45 2e 42 09 30 28 41 | 32 2c 44 32 2e 57 29 2c |VE.B.0(A|2,D2.W),|
|000012e0| 44 33 0d 09 4d 4f 56 45 | 2e 42 09 2d 31 28 41 30 |D3..MOVE|.B.-1(A0|
|000012f0| 29 2c 44 32 0d 09 43 4d | 50 2e 42 09 30 28 41 32 |),D2..CM|P.B.0(A2|
|00001300| 2c 44 32 2e 57 29 2c 44 | 33 0d 09 42 45 51 2e 53 |,D2.W),D|3..BEQ.S|
|00001310| 09 6c 70 32 74 73 74 0d | 65 6e 64 09 4d 4f 56 45 |.lp2tst.|end.MOVE|
|00001320| 4d 09 28 53 50 29 2b 2c | 44 32 2f 44 33 2f 41 32 |M.(SP)+,|D2/D3/A2|
|00001330| 0d 3b 63 6f 64 65 0d 0d | 0d 5c 20 43 53 43 48 20 |.;code..|.\ CSCH |
|00001340| 61 6e 64 20 3c 43 53 43 | 48 20 61 72 65 20 74 68 |and <CSC|H are th|
|00001350| 65 20 70 72 69 6d 69 74 | 69 76 65 20 73 75 62 72 |e primit|ive subr|
|00001360| 6f 75 74 69 6e 65 73 20 | 66 6f 72 20 73 65 61 72 |outines |for sear|
|00001370| 63 68 69 6e 67 20 66 6f | 72 20 61 20 73 69 6e 67 |ching fo|r a sing|
|00001380| 6c 65 0d 5c 20 63 68 61 | 72 61 63 74 65 72 2e 0d |le.\ cha|racter..|
|00001390| 5c 09 41 30 20 2d 3e 20 | 73 74 72 69 6e 67 0d 5c |\.A0 -> |string.\|
|000013a0| 09 44 30 20 3d 20 6c 65 | 6e 67 74 68 0d 5c 09 44 |.D0 = le|ngth.\.D|
|000013b0| 32 20 3d 20 6c 65 6e 67 | 74 68 20 28 68 69 29 0d |2 = leng|th (hi).|
|000013c0| 5c 09 44 31 20 3d 20 63 | 68 61 72 20 28 72 65 73 |\.D1 = c|har (res|
|000013d0| 74 20 6d 75 73 74 20 62 | 65 20 7a 65 72 6f 29 0d |t must b|e zero).|
|000013e0| 5c 20 42 6f 74 68 20 72 | 6f 75 74 69 6e 65 73 20 |\ Both r|outines |
|000013f0| 72 65 74 75 72 6e 20 77 | 69 74 68 20 74 68 65 20 |return w|ith the |
|00001400| 43 43 20 73 65 74 20 61 | 70 70 72 6f 70 72 69 61 |CC set a|ppropria|
|00001410| 74 65 6c 79 2e 0d 0d 3a | 63 6f 64 65 20 43 53 43 |tely...:|code CSC|
|00001420| 48 0d 09 6c 6f 63 0d 09 | 54 53 54 09 64 69 63 5b |H..loc..|TST.dic[|
|00001430| 63 61 73 65 3f 5d 0d 09 | 42 45 51 2e 53 09 6e 6f |case?]..|BEQ.S.no|
|00001440| 63 61 73 65 0d 09 42 52 | 41 2e 53 09 6c 70 31 74 |case..BR|A.S.lp1t|
|00001450| 73 74 09 3b 20 4e 6f 74 | 65 3a 20 77 65 20 65 6e |st.; Not|e: we en|
|00001460| 74 65 72 20 74 68 65 20 | 6c 6f 6f 70 20 77 69 74 |ter the |loop wit|
|00001470| 68 20 22 6e 6f 74 20 65 | 71 75 61 6c 22 0d 0d 6c |h "not e|qual"..l|
|00001480| 6f 6f 70 31 09 43 4d 50 | 2e 42 09 28 41 30 29 2b |oop1.CMP|.B.(A0)+|
|00001490| 2c 44 31 0d 6c 70 31 74 | 73 74 09 44 42 45 51 09 |,D1.lp1t|st.DBEQ.|
|000014a0| 44 30 2c 6c 6f 6f 70 31 | 0d 09 44 42 45 51 09 44 |D0,loop1|..DBEQ.D|
|000014b0| 32 2c 6c 6f 6f 70 31 0d | 09 52 54 53 0d 0d 6e 6f |2,loop1.|.RTS..no|
|000014c0| 63 61 73 65 09 4d 4f 56 | 45 4d 09 44 31 2f 44 32 |case.MOV|EM.D1/D2|
|000014d0| 2f 41 32 2c 2d 28 53 50 | 29 0d 09 4c 45 41 09 31 |/A2,-(SP|)..LEA.1|
|000014e0| 30 28 64 69 63 5b 55 43 | 74 62 6c 5d 29 2c 41 32 |0(dic[UC|tbl]),A2|
|000014f0| 0d 09 4d 4f 56 45 2e 42 | 09 30 28 41 32 2c 44 31 |..MOVE.B|.0(A2,D1|
|00001500| 2e 57 29 2c 44 31 0d 09 | 4d 4f 56 45 51 09 23 31 |.W),D1..|MOVEQ.#1|
|00001510| 2c 44 32 09 3b 20 53 65 | 74 20 22 6e 6f 74 20 65 |,D2.; Se|t "not e|
|00001520| 71 75 61 6c 22 2c 20 63 | 6c 65 61 72 20 74 6f 70 |qual", c|lear top|
|00001530| 20 33 20 62 79 74 65 73 | 20 6f 66 20 44 32 0d 09 | 3 bytes| of D2..|
|00001540| 42 52 41 2e 53 09 6c 70 | 32 74 73 74 0d 0d 6f 75 |BRA.S.lp|2tst..ou|
|00001550| 74 65 72 09 4d 4f 56 45 | 09 44 32 2c 34 28 53 50 |ter.MOVE|.D2,4(SP|
|00001560| 29 0d 6c 6f 6f 70 32 09 | 4d 4f 56 45 2e 42 09 28 |).loop2.|MOVE.B.(|
|00001570| 41 30 29 2b 2c 44 32 0d | 09 43 4d 50 2e 42 09 30 |A0)+,D2.|.CMP.B.0|
|00001580| 28 41 32 2c 44 32 2e 57 | 29 2c 44 31 0d 6c 70 32 |(A2,D2.W|),D1.lp2|
|00001590| 74 73 74 09 44 42 45 51 | 09 44 30 2c 6c 6f 6f 70 |tst.DBEQ|.D0,loop|
|000015a0| 32 0d 09 4d 4f 56 45 4d | 09 34 28 53 50 29 2c 44 |2..MOVEM|.4(SP),D|
|000015b0| 32 09 3b 20 52 65 63 6f | 76 65 72 20 6f 75 74 65 |2.; Reco|ver oute|
|000015c0| 72 20 6c 6f 6f 70 20 63 | 6f 75 6e 74 65 72 2c 20 |r loop c|ounter, |
|000015d0| 70 72 65 73 65 72 76 69 | 6e 67 20 43 43 0d 09 44 |preservi|ng CC..D|
|000015e0| 42 45 51 09 44 32 2c 6f | 75 74 65 72 0d 09 4d 4f |BEQ.D2,o|uter..MO|
|000015f0| 56 45 4d 09 28 53 50 29 | 2b 2c 44 31 2f 44 32 2f |VEM.(SP)|+,D1/D2/|
|00001600| 41 32 0d 65 6e 64 0d 3b | 63 6f 64 65 0d 0d 3a 63 |A2.end.;|code..:c|
|00001610| 6f 64 65 20 3c 43 53 43 | 48 0d 09 6c 6f 63 0d 09 |ode <CSC|H..loc..|
|00001620| 54 53 54 09 64 69 63 5b | 63 61 73 65 3f 5d 0d 09 |TST.dic[|case?]..|
|00001630| 42 45 51 2e 53 09 6e 6f | 63 61 73 65 0d 09 42 52 |BEQ.S.no|case..BR|
|00001640| 41 2e 53 09 6c 70 31 74 | 73 74 09 09 3b 20 4e 6f |A.S.lp1t|st..; No|
|00001650| 74 65 3a 20 77 65 20 65 | 6e 74 65 72 20 74 68 65 |te: we e|nter the|
|00001660| 20 6c 6f 6f 70 20 77 69 | 74 68 20 22 6e 6f 74 20 | loop wi|th "not |
|00001670| 65 71 75 61 6c 22 0d 0d | 6c 6f 6f 70 31 09 43 4d |equal"..|loop1.CM|
|00001680| 50 2e 42 09 2d 28 41 30 | 29 2c 44 31 0d 6c 70 31 |P.B.-(A0|),D1.lp1|
|00001690| 74 73 74 09 44 42 45 51 | 09 44 30 2c 6c 6f 6f 70 |tst.DBEQ|.D0,loop|
|000016a0| 31 0d 09 44 42 45 51 09 | 44 32 2c 6c 6f 6f 70 31 |1..DBEQ.|D2,loop1|
|000016b0| 0d 09 42 52 41 2e 53 09 | 65 6e 64 0d 0d 6e 6f 63 |..BRA.S.|end..noc|
|000016c0| 61 73 65 09 4d 4f 56 45 | 4d 09 44 31 2f 44 32 2f |ase.MOVE|M.D1/D2/|
|000016d0| 41 32 2c 2d 28 53 50 29 | 0d 09 4c 45 41 09 31 30 |A2,-(SP)|..LEA.10|
|000016e0| 28 64 69 63 5b 55 43 74 | 62 6c 5d 29 2c 41 32 0d |(dic[UCt|bl]),A2.|
|000016f0| 09 4d 4f 56 45 2e 42 09 | 30 28 41 32 2c 44 31 2e |.MOVE.B.|0(A2,D1.|
|00001700| 57 29 2c 44 31 0d 09 4d | 4f 56 45 51 09 23 31 2c |W),D1..M|OVEQ.#1,|
|00001710| 44 32 09 09 3b 20 53 65 | 74 20 22 6e 6f 74 20 65 |D2..; Se|t "not e|
|00001720| 71 75 61 6c 22 2c 20 63 | 6c 65 61 72 20 74 6f 70 |qual", c|lear top|
|00001730| 20 33 20 62 79 74 65 73 | 20 6f 66 20 44 32 0d 09 | 3 bytes| of D2..|
|00001740| 42 52 41 2e 53 09 6c 70 | 32 74 73 74 0d 0d 6f 75 |BRA.S.lp|2tst..ou|
|00001750| 74 65 72 09 4d 4f 56 45 | 09 44 32 2c 34 28 53 50 |ter.MOVE|.D2,4(SP|
|00001760| 29 0d 6c 6f 6f 70 32 09 | 4d 4f 56 45 2e 42 09 2d |).loop2.|MOVE.B.-|
|00001770| 28 41 30 29 2c 44 32 0d | 09 43 4d 50 2e 42 09 30 |(A0),D2.|.CMP.B.0|
|00001780| 28 41 32 2c 44 32 2e 57 | 29 2c 44 31 0d 6c 70 32 |(A2,D2.W|),D1.lp2|
|00001790| 74 73 74 09 44 42 45 51 | 09 44 30 2c 6c 6f 6f 70 |tst.DBEQ|.D0,loop|
|000017a0| 32 0d 09 4d 4f 56 45 4d | 09 34 28 53 50 29 2c 44 |2..MOVEM|.4(SP),D|
|000017b0| 32 09 3b 20 52 65 63 6f | 76 65 72 20 6f 75 74 65 |2.; Reco|ver oute|
|000017c0| 72 20 6c 6f 6f 70 20 63 | 6f 75 6e 74 65 72 2c 20 |r loop c|ounter, |
|000017d0| 70 72 65 73 65 72 76 69 | 6e 67 20 43 43 0d 09 44 |preservi|ng CC..D|
|000017e0| 42 45 51 09 44 32 2c 6f | 75 74 65 72 0d 09 4d 4f |BEQ.D2,o|uter..MO|
|000017f0| 56 45 4d 09 28 53 50 29 | 2b 2c 44 31 2f 44 32 2f |VEM.(SP)|+,D1/D2/|
|00001800| 41 32 0d 65 6e 64 0d 3b | 63 6f 64 65 0d 0d 0d 5c |A2.end.;|code...\|
|00001810| 20 43 4d 50 53 54 52 20 | 28 20 61 64 64 72 31 20 | CMPSTR |( addr1 |
|00001820| 6c 65 6e 31 20 61 64 64 | 72 32 20 6c 65 6e 32 20 |len1 add|r2 len2 |
|00001830| 2d 2d 20 6e 20 29 20 63 | 6f 6d 70 61 72 65 73 20 |-- n ) c|ompares |
|00001840| 32 20 73 74 72 69 6e 67 | 73 2e 0d 5c 20 43 61 73 |2 string|s..\ Cas|
|00001850| 65 20 69 73 20 73 69 67 | 6e 69 66 69 63 61 6e 74 |e is sig|nificant|
|00001860| 20 69 66 20 43 41 53 45 | 3f 20 69 73 20 73 65 74 | if CASE|? is set|
|00001870| 20 74 6f 20 74 72 75 65 | 2e 0d 5c 20 52 65 74 75 | to true|..\ Retu|
|00001880| 72 6e 73 3a 0d 5c 20 20 | 2d 31 20 20 20 66 69 72 |rns:.\ |-1 fir|
|00001890| 73 74 20 73 74 72 69 6e | 67 20 6c 6f 77 0d 5c 20 |st strin|g low.\ |
|000018a0| 20 20 30 20 20 20 73 74 | 72 69 6e 67 73 20 61 72 | 0 st|rings ar|
|000018b0| 65 20 65 71 75 61 6c 0d | 5c 20 20 20 31 20 20 20 |e equal.|\ 1 |
|000018c0| 66 69 72 73 74 20 73 74 | 72 69 6e 67 20 68 69 67 |first st|ring hig|
|000018d0| 68 0d 5c 20 57 65 20 61 | 73 73 75 6d 65 20 74 68 |h.\ We a|ssume th|
|000018e0| 65 20 6c 65 6e 67 74 68 | 73 20 61 72 65 20 62 6f |e length|s are bo|
|000018f0| 74 68 20 6c 65 73 73 20 | 74 68 61 6e 20 36 34 4b |th less |than 64K|
|00001900| 2e 0d 5c 0d 5c 20 55 73 | 65 73 20 44 30 2c 44 31 |..\.\ Us|es D0,D1|
|00001910| 2c 44 32 2c 41 30 2c 41 | 31 2e 0d 0d 3a 63 6f 64 |,D2,A0,A|1...:cod|
|00001920| 65 20 43 4d 50 53 54 52 | 0d 09 6c 6f 63 0d 09 50 |e CMPSTR|..loc..P|
|00001930| 4f 50 09 44 30 09 09 3b | 20 44 30 20 3d 20 6c 65 |OP.D0..;| D0 = le|
|00001940| 6e 32 0d 09 50 4f 50 09 | 41 30 09 09 3b 20 41 30 |n2..POP.|A0..; A0|
|00001950| 20 3d 20 61 64 64 72 32 | 0d 09 50 4f 50 09 44 31 | = addr2|..POP.D1|
|00001960| 09 09 3b 20 44 31 20 3d | 20 6c 65 6e 31 0d 09 4d |..; D1 =| len1..M|
|00001970| 4f 56 45 09 28 53 50 29 | 2c 41 31 09 09 3b 20 41 |OVE.(SP)|,A1..; A|
|00001980| 31 20 3d 20 61 64 64 72 | 31 0d 09 4d 4f 56 45 51 |1 = addr|1..MOVEQ|
|00001990| 09 23 30 2c 44 32 09 09 | 3b 20 44 32 20 77 69 6c |.#0,D2..|; D2 wil|
|000019a0| 6c 20 68 6f 6c 64 20 72 | 65 74 75 72 6e 20 72 65 |l hold r|eturn re|
|000019b0| 73 75 6c 74 0d 09 43 4d | 50 2e 57 09 44 31 2c 44 |sult..CM|P.W.D1,D|
|000019c0| 30 09 09 3b 20 43 6f 6d | 70 61 72 65 20 6c 65 6e |0..; Com|pare len|
|000019d0| 67 74 68 73 0d 09 42 45 | 51 2e 53 09 64 6f 63 6d |gths..BE|Q.S.docm|
|000019e0| 70 0d 09 42 48 49 2e 53 | 09 6f 70 32 6c 6f 6e 67 |p..BHI.S|.op2long|
|000019f0| 0d 09 4d 4f 56 45 51 09 | 23 31 2c 44 32 0d 09 42 |..MOVEQ.|#1,D2..B|
|00001a00| 52 41 2e 53 09 64 6f 63 | 6d 70 0d 0d 6f 70 32 6c |RA.S.doc|mp..op2l|
|00001a10| 6f 6e 67 09 4d 4f 56 45 | 2e 57 09 44 31 2c 44 30 |ong.MOVE|.W.D1,D0|
|00001a20| 0d 09 4d 4f 56 45 51 09 | 23 2d 31 2c 44 32 0d 0d |..MOVEQ.|#-1,D2..|
|00001a30| 64 6f 63 6d 70 09 42 53 | 52 09 64 69 63 5b 63 63 |docmp.BS|R.dic[cc|
|00001a40| 6d 70 5d 0d 09 42 45 51 | 2e 53 09 65 6e 64 0d 09 |mp]..BEQ|.S.end..|
|00001a50| 53 4d 49 09 44 32 0d 09 | 4f 52 49 2e 42 09 23 31 |SMI.D2..|ORI.B.#1|
|00001a60| 2c 44 32 0d 09 45 58 54 | 2e 57 09 44 32 0d 09 45 |,D2..EXT|.W.D2..E|
|00001a70| 58 54 2e 4c 09 44 32 0d | 65 6e 64 09 4d 4f 56 45 |XT.L.D2.|end.MOVE|
|00001a80| 09 44 32 2c 28 53 50 29 | 0d 3b 63 6f 64 65 0d 0d |.D2,(SP)|.;code..|
|00001a90| 0d 5c 20 49 4e 53 54 45 | 41 44 20 28 20 63 2d 6f |.\ INSTE|AD ( c-o|
|00001aa0| 6c 64 20 63 2d 6e 65 77 | 20 2d 2d 20 29 20 20 6d |ld c-new| -- ) m|
|00001ab0| 61 79 20 62 65 20 75 73 | 65 64 20 6a 75 73 74 20 |ay be us|ed just |
|00001ac0| 61 66 74 65 72 20 61 20 | 53 43 4f 4e 20 69 73 20 |after a |SCON is |
|00001ad0| 64 65 66 69 6e 65 64 2e | 0d 5c 20 57 69 74 68 69 |defined.|.\ Withi|
|00001ae0| 6e 20 74 68 65 20 53 43 | 4f 4e 2c 20 69 74 20 72 |n the SC|ON, it r|
|00001af0| 65 70 6c 61 63 65 73 20 | 61 6e 79 20 6f 63 63 75 |eplaces |any occu|
|00001b00| 72 72 65 6e 63 65 73 20 | 6f 66 20 63 2d 6f 6c 64 |rrences |of c-old|
|00001b10| 20 77 69 74 68 20 63 2d | 6e 65 77 2e 20 20 54 68 | with c-|new. Th|
|00001b20| 69 73 20 0d 5c 20 6f 70 | 65 72 61 74 69 6f 6e 20 |is .\ op|eration |
|00001b30| 69 73 20 75 73 65 66 75 | 6c 20 66 6f 72 20 63 72 |is usefu|l for cr|
|00001b40| 65 61 74 69 6e 67 20 53 | 43 4f 4e 73 20 63 6f 6e |eating S|CONs con|
|00001b50| 74 61 69 6e 69 6e 67 20 | 73 70 65 63 69 61 6c 20 |taining |special |
|00001b60| 63 68 61 72 61 63 74 65 | 72 73 0d 5c 20 73 75 63 |characte|rs.\ suc|
|00001b70| 68 20 61 73 20 74 61 62 | 2e 0d 0d 3a 20 49 4e 53 |h as tab|...: INS|
|00001b80| 54 45 41 44 20 20 7b 20 | 63 2d 6f 6c 64 20 63 2d |TEAD { |c-old c-|
|00001b90| 6e 65 77 20 2d 2d 20 7d | 0d 09 6c 61 74 65 73 74 |new -- }|..latest|
|00001ba0| 20 6e 61 6d 65 3e 20 65 | 78 2d 67 65 6e 20 20 62 | name> e|x-gen b|
|00001bb0| 6f 75 6e 64 73 09 5c 20 | 53 43 4f 4e 73 20 75 73 |ounds.\ |SCONs us|
|00001bc0| 65 20 44 4f 45 53 3e 20 | 73 6f 20 72 65 71 75 69 |e DOES> |so requi|
|00001bd0| 72 65 20 45 58 2d 47 45 | 4e 0d 09 44 4f 20 20 20 |re EX-GE|N..DO |
|00001be0| 69 20 63 40 20 63 2d 6f | 6c 64 20 3d 20 49 46 20 |i c@ c-o|ld = IF |
|00001bf0| 20 63 2d 6e 65 77 20 69 | 20 63 21 20 20 54 48 45 | c-new i| c! THE|
|00001c00| 4e 0d 09 4c 4f 4f 50 20 | 20 3b 0d 00 00 00 00 00 |N..LOOP | ;......|
|00001c10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c80| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00001c90| 49 54 0d 09 09 70 72 6f | 63 65 73 73 46 69 6c 65 |IT...pro|cessFile|
|00001ca0| 0d 09 09 63 6c 6f 73 65 | 3a 20 63 75 72 72 46 69 |...close|: currFi|
|00001cb0| 0c 53 74 72 55 74 69 6c | 69 74 69 65 73 6c 02 00 |.StrUtil|itiesl..|
|00001cc0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001cd0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cf0| 00 00 b3 66 c2 79 00 00 | 00 00 00 00 01 1e 65 61 |...f.y..|......ea|
|00001d00| 73 65 3a 20 69 6e 70 20 | 20 72 65 6c 65 61 73 65 |se: inp | release|
|00001d10| 3a 20 6f 75 74 70 0d 09 | 72 65 6c 65 61 73 65 3a |: outp..|release:|
|00001d20| 20 74 68 65 57 6f 72 64 | 20 20 72 65 6c 65 61 73 | theWord| releas|
|00001d30| 65 3a 20 74 68 65 4b 6f | 6e 73 74 20 20 3b 0d 0d |e: theKo|nst ;..|
|00001d40| 65 6e 64 6c 6f 61 64 0d | 0d 20 20 72 65 6c 65 61 |endload.|. relea|
|00001d50| 73 65 3a 20 6f 75 74 70 | 0d 09 72 65 6c 65 61 73 |se: outp|..releas|
|00001d60| 65 3a 20 74 68 65 57 6f | 72 64 20 20 72 65 6c 65 |e: theWo|rd rele|
|00001d70| 61 73 65 3a 20 74 68 65 | 4b 6f 6e 73 74 20 20 3b |ase: the|Konst ;|
|00001d80| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00001d90| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00001da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+